Method for counting regional population, computer device and computer readable storage medium

ABSTRACT

Disclosed are a method for counting regional population, a computer device and a computer readable storage medium. The method for counting regional population includes: acquiring an image to be analyzed in a target region; detecting a position of each first human body part in the image to be analyzed; determining, according to the position of each first human body part in the image to be analyzed and a first transformation relation, a physical position of each first human body part in the target region; and determining the population in each sub-region according to a relative positional relation between the position of the first human body part in the image to be analyzed and the sub-image, as well as a relative positional relation between the physical position of the first human body part and the sub-region.

TECHNICAL FIELD

The present disclosure relates to the field of display technology, andparticularly relates to a method for counting regional population, acomputer device and a computer readable storage medium.

BACKGROUND

In the field of video monitoring, population counting often need to beperformed in a monitored region. A relatively accurate populationcounting result is one of the important parameters for people safety,while providing valuable guide information for industries such asresource management, public transportation, advertisement putting andthe like.

For population counting in an open region, the open region is generallydivided into a plurality of sub-regions in each of which the populationis counted respectively. A problem with current statistical methods islow accuracy.

SUMMARY

The embodiments of the disclosure provide a method for counting regionalpopulation, a computer device and a computer readable storage medium.

In a first aspect, the present disclosure provides a method for countingregional population, including:

acquiring an image to be analyzed in a target region, wherein the targetregion includes at least one sub-region, and the image to be analyzedincludes at least one sub-image corresponding to the at least onesub-region one by one;

detecting a position of each first human body part in the image to beanalyzed;

determining, according to the position of each first human body part inthe image to be analyzed and a first transformation relation, a physicalposition of each first human body part in the target region, wherein thefirst transformation relation is a transformation relation between aphysical position of the first human body part in the target region anda position thereof in the image to be analyzed; and

determining the population in each sub-region according to a relativepositional relation between the position of the first human body part inthe image to be analyzed and the sub-image, as well as a relativepositional relation between the physical position of the first humanbody part and the sub-region.

In some embodiments, the first human body part includes a head; and themethod for counting regional population further includes:

acquiring a calibration image of the target region;

determining the first transformation relation according to a physicalposition of a preset part of a mark object in the target region and animage position of the preset part of the mark object in the calibrationimage; and

acquiring a physical range of the sub-region.

In some embodiments, a height of the mark object is within a standardhuman height range, and the preset part of the mark object is a top ofthe mark object.

In some embodiments, the step of acquiring the physical range of thesub-region includes:

determining a second transformation relation according to a physicalposition of a bottom of the mark object and a position of the bottom ofthe mark object in the calibration image; wherein the secondtransformation relation is a transformation relation between thephysical position of the bottom of the mark object and the position ofthe bottom of the mark object in the calibration image;

acquiring positions of a plurality of feature points defining thesub-region in the calibration image;

determining a physical position of each feature point according to aposition of the feature point in the calibration image and the secondtransformation relation; and

determining the physical range of the sub-region according to thephysical positions of the plurality of feature points.

In some embodiments, a plurality of mark objects are present in thetarget region, and the first transformation relation includes a firstposition transformation matrix that is determined according to thefollowing 3:

$\begin{matrix}{\begin{bmatrix}X \\Y \\1\end{bmatrix} = {\left. H \right.\_{1\begin{bmatrix}u \\v \\1\end{bmatrix}}}} & (1)\end{matrix}$

where H_1 is the first position transformation matrix; X is aone-dimensional vector formed by abscissas of the tops of the pluralityof the mark objects in a physical world coordinate system; Y is aone-dimensional vector formed by ordinates of the bottoms of theplurality of mark objects in the physical world coordinate system; u isa one-dimensional vector formed by abscissas of the tops of theplurality of mark objects in the calibration image; and v is aone-dimensional vector formed by ordinates of the tops of the pluralityof mark objects in the calibration image.

In some embodiments, the second transformation relation includes asecond position transformation matrix that is determined according tothe following equation (2):

$\begin{matrix}{\begin{bmatrix}X \\Y \\1\end{bmatrix} = {\left. H \right.\_{2\begin{bmatrix}{uu} \\{vv} \\1\end{bmatrix}}}} & (2)\end{matrix}$

where H_2 is the second position transformation matrix; uu is aone-dimensional vector formed by the abscissas of the bottoms of theplurality of mark objects in the calibration image; and vv is aone-dimensional vector formed by ordinates of the bottoms of theplurality of mark objects in the calibration image.

In some embodiments, the step of determining the population in eachsub-region according to the relative positional relation between theposition of the first human body part in the image to be analyzed andthe sub-image, as well as the relative positional relation between thephysical position of the first human body part and the sub-regionincludes:

judging, for each sub-region, whether each first human body part islocated in the sub-region using a two-level comparison method, anddetermining the population in the sub-region according to the judgmentresult;

wherein, the two-level comparison method includes: judging whether theposition of the first human body part in the image to be analyzed islocated in the range of the sub-image; judging, when the position of thefirst human body part in the image to be analyzed is located in therange of the sub-image, whether the physical position of the first humanbody part is located in the range of the sub-region; and determiningthat the first human body part is located in the sub-region when thephysical position of the first human body part is located in the rangeof the sub-region.

In some embodiments, the step of judging whether the position of thefirst human body part in the image to be analyzed is located in therange of the sub-image includes:

judging whether a first reference line and a boundary of the sub-imagehave intersections; wherein the first reference line is a straight linepassing through the position of the first human body part in the imageto be analyzed; and

determining that the position of the first human body part in the imageto be analyzed is located in the range of the sub-image when the firstreference line and the boundary of the sub-image have intersections, andan odd number of intersections are present on both sides of the positionof the first human body part in the image to be analyzed; and

judging whether the physical position of the first human body part islocated in the sub-region, including:

judging whether a second reference line and a boundary of the sub-regionhave intersections; wherein the second reference line is a straight linepassing through the physical position of the first human body part; and

determining that the physical position of the first human body part islocated in the sub-region when the second reference line and theboundary of the sub-region have intersections and an odd number ofintersections are present on both sides of the physical position of thefirst human body part.

In some embodiments, the position of the first human body part in theimage to be analyzed is detected by a target detection algorithm basedon deep learning.

In a second aspect, an embodiment of the present disclosure furtherprovides a computer device, including:

a processor; and

a memory having a program stored thereon which, when executed by theprocessor, causes the following steps to be implemented:

acquiring an image to be analyzed in a target region, wherein the targetregion includes at least one sub-region, and the image to be analyzedincludes at least one sub-image corresponding to the at least onesub-region one by one;

detecting a position of each first human body part in the image to beanalyzed;

determining, according to the position of each first human body part inthe image to be analyzed and a first transformation relation, a physicalposition of each first human body part in the target region, wherein thefirst transformation relation is a transformation relation between aphysical position of the first human body part in the target region anda position thereof in the image to be analyzed; and

determining the population in each sub-region according to a relativepositional relation between the position of the first human body part inthe image to be analyzed and the sub-image, as well as a relativepositional relation between the physical position of the first humanbody part and the sub-region.

In some embodiments, the first human body part includes a head; and

the program, when executed by the processor, further causes thefollowing steps to be implemented:

acquiring a calibration image of the target region;

determining the first transformation relation according to a physicalposition of a preset part of a mark object in the target region and animage position of the preset part of the mark object in the calibrationimage; and

acquiring a physical range of the sub-region.

In a third aspect, an embodiment of the present disclosure furtherprovides a computer readable storage medium having a computer programstored thereon, wherein when executed by a processor, the program causesthe method for counting regional population as described above to beimplemented.

BRIEF DESCRIPTION OF THE DRAWINGS

Accompanying drawings are provided for further understanding of thisdisclosure and constitute a part of the specification. Hereinafter,these drawings are intended to explain the disclosure together with thefollowing specific embodiments, but should not be considered as alimitation of the disclosure. In the drawings:

FIG. 1 is a flowchart of a method for counting regional populationaccording to an embodiment of the present disclosure.

FIG. 2 is a flowchart of another method for counting regional populationaccording to an embodiment of the present disclosure.

FIG. 3 is a flowchart of a two-level comparison method according to anembodiment of the present disclosure.

FIG. 4A is a schematic diagram showing an image position of a firsthuman body part in an image to be analyzed located within a range of asub-image according to an embodiment of the present disclosure.

FIG. 4B is a schematic diagram showing an image position of a firsthuman body part in an image to be analyzed located beyond a range of asub-image according to an embodiment of the present disclosure.

FIG. 5 is a schematic diagram of a device for counting regionalpopulation according to an embodiment of the present disclosure.

FIG. 6 is a schematic diagram of another device for counting regionalpopulation according to an embodiment of the present disclosure.

DETAILED DESCRIPTION OF THE EMBODIMENTS

Hereinafter, specific embodiments of the present disclosure will bedescribed with respect to the accompanying drawings. It should beunderstood that the specific embodiments as set forth herein are merelyfor the purpose of illustration and explanation of the disclosure andshould not be constructed as a limitation thereof.

When the distributed population in each of a plurality of sub-regions ofan open region is counted in the related art, an image of the openregion is captured first to detect a position of a human body in theimage, then the position of the human body in the image is compared witha position of the sub-region in the image to determine in whichsub-region the human body is located, and then the population in eachsub-region is counted. However, in the captured image, a human bodyoften has a head and feet in different positions of the image, andtherefore, the image may include a state where: one part of the humanbody has entered a certain sub-region, while the other part of the humanbody is outside that sub-region. As a result, when determining thesub-region in which the human body is located, it is easy to make anerror in judgement and thus lead to an inaccurate counting result.

FIG. 1 is a flowchart of a method for counting regional populationaccording to an embodiment of the present disclosure. As shown in FIG.1, the method for counting regional population includes the followingsteps S1 to S4.

At step S1, an image to be analyzed in a target region is acquired,wherein the target region includes at least one sub-region, and theimage to be analyzed includes at least one sub-image corresponding tothe at least one sub-region one by one. The image to be analyzed may bean image of the target region captured by an image capturing device suchas a camera, and the sub-image is an image of a sub-region captured bythe image capturing device. In addition, the image capturing device mayacquire an image of the target region captured in real time, and in stepS1, each frame of the image captured by the image capturing device maybe acquired, or the image captured by the image capturing device may beacquired at a predetermined frequency.

For example, a plurality of sub-images and a plurality of sub-regionsare provided.

At step S2, an image position of each first human body part in the imageto be analyzed is detected.

The first human body part is a part that can characterize a position ofa human body. For example, the first human body part may be a head, or ashoulder.

At step S3, according to the image position of each first human bodypart and a first transformation relation, a physical position of eachfirst human body part in the target region is determined.

The term “physical position” in the embodiment of the present disclosurerefers to a corresponding position in the physical world. The firsttransformation relation is a transformation relation between a physicalposition of the first human body part in the three-dimensional physicalworld and an image position thereof in the image to be analyzed. Forexample, the first transformation relation is a mapping relationshiptable. For another example, the first transformation relation is aperspective projection matrix. The first transformation relation may beobtained in advance before step S1.

At step S4, the population in each sub-region is determined according toa relative positional relation between the image position of the firsthuman body part and the sub-image, as well as a relative positionalrelation between the physical position of the first human body part andthe sub-region.

In the embodiments of the present disclosure, the relative positionalrelation between the image position of the first human body part and thesub-image means whether the image position of the first human body partis located in or outside a range of the sub-image; and the relativepositional relation between the physical position of the first humanbody part and the sub-region means whether the physical position of thefirst human body part is located in or outside a range of thesub-region.

In step S4, when determining the population in a certain sub-region, itis first determined whether each first human body part is located in thesub-region, and then the population in the sub-region. When thefollowing two conditions are both satisfied, it is determined that thefirst human body part is located in the range of the sub-region; andwhen at least one of the following two conditions is not satisfied, itis determined that the first human body part is located outside therange of the sub-region.

Condition I: the image position of the first human body part is locatedin the range of the sub-image; and

Condition II: the physical position of the first human body part islocated in the range of the sub-region.

Therefore, when it is determined that Condition I is not satisfied,there may be no need to judge whether Condition II is satisfied; or,when it is determined that Condition II is not satisfied, there may beno need to judge whether Condition I is satisfied.

After step S4, the population in each sub-region may be transmitted toan output device for output. The output device is, for example, adisplay that displays the population in each physical region by way ofdisplay.

In the embodiments of the present disclosure, when counting thepopulation in each sub-region, the population in the sub-region isdetermined in combination with the positional relation between the imageposition of the first human body part and the sub-image, as well as thepositional relation between the first human body part and thesub-region. The statistical method provided in the embodiments of thepresent disclosure has improved statistical accuracy compared to eitherthe method determines whether a human body is in a sub-region merelythrough the position between the image position of the first human bodypart and the sub-image, or the method determines whether a human body isin a sub-region merely through the position between the physicalposition of the first human body part and the sub-region.

In some embodiments, the first human body part includes a head. Bydetermining the population based on detection the position and thephysical position of the head of the human body in the image to beanalyzed, the accuracy of population counting is improved, and when thefirst human body part includes a head, the position of the head of thehuman body in the image to be analyzed can be detected using a targetdetection algorithm, thereby increasing the detection speed.

FIG. 2 is a flowchart of another method for counting regional populationaccording to an embodiment of the present disclosure. As shown in FIG.2, the method for counting regional population includes the followingsteps.

At step S01, a calibration image of the target region is acquired. Thecalibration image may be an image of a target region captured by animage capturing device.

At step S02, the first transformation relation is determined accordingto a physical position of a preset part of a mark object in the targetregion and an image position of the preset part of the mark object inthe calibration image. For example, the image position of the presetpart of the mark object in the calibration image may be acquired using atarget detection method; obviously, other methods may be adopted.

Optionally, a plurality of mark objects are provided, which may beobjects at mark points of the target region, such as a human body model,an upright pole, or a real person. A height of the mark object is withina standard human height range, and the preset part of the mark object isa top of the mark object. It should be noted that the standard humanheight range is a height range of a conventional adult, e.g., 1.5 m to 2m. In addition, it should be noted that: the mark object is disposed onthe ground of the target region, the top of the mark object is an endthereof away from the ground, and the bottom of the mark object is anend thereof closer to the ground.

In some embodiments, the first transformation relation includes a firstposition transformation matrix H_1 that is determined according to thefollowing equation (1):

$\begin{matrix}{\begin{bmatrix}X \\Y \\1\end{bmatrix} = {\left. H \right.\_{1\begin{bmatrix}u \\v \\1\end{bmatrix}}}} & (1)\end{matrix}$

where X is a one-dimensional vector formed by abscissas of the tops ofthe plurality of the mark objects in a physical world coordinate system;Y is a one-dimensional vector formed by ordinates of the bottoms of theplurality of mark objects in the physical world coordinate system; u isa one-dimensional vector formed by abscissas of the tops of theplurality of mark objects in the calibration image; and v is aone-dimensional vector formed by ordinates of the tops of the pluralityof mark objects in the calibration image. It should be noted that thephysical world coordinate system is a two-dimensional plane coordinatesystem located on a horizontal plane, and therefore the top and thebottom of the mark object have the same coordinates in the physicalworld coordinate system, while the top and the bottom of the mark objectmay not have the same coordinates in the calibration image since theimage capturing device does not necessarily capture an image fromdirectly above the mark object. In addition, an image coordinate systemmay be established on the calibration image; and the coordinates of thetop (bottom) of the mark object in the calibration image are thecoordinates of the top (bottom) of the mark object in the imagecoordinate system.

Exemplarily, there are four mark objects, the coordinates of the tops ofthe four mark objects in the physical world coordinate system arerespectively (X1, Y1), (X2, Y2), (X3, Y3) and (X4, Y4), and the bottomand the top of each mark object have the same coordinates in thephysical world coordinate system. The coordinates of the tops of thefour mark objects in the calibration image are respectively: (u1, v1),(u2, v2), (u3, v3) and (u4, v4). Then, the above equation (1) is:

$\begin{bmatrix}{X1} & {X2} & {X3} & {X4} \\{Y1} & {Y2} & {Y3} & {Y4} \\1 & 1 & 1 & 1\end{bmatrix} = {\left. H \right.\_{1\begin{bmatrix}{u1} & {u2} & {u3} & {u4} \\{vl} & {v2} & {v3} & {v4} \\1 & 1 & 1 & 1\end{bmatrix}}}$

At step S03, a physical range of the sub-region, that is, a rangesurrounded by the boundary of the sub-region in the target region, isacquired.

For example, by acquiring the physical positions of a plurality offeature points at the boundary of the sub-region, the physical positionof the boundary of the sub-region is determined according to thephysical positions of the plurality of feature points. The plurality offeature points are used to define a sub-region. For example, thesub-region is a polygonal region, and the plurality of feature pointsare a plurality of corner points of the sub-region. The positions of thefeature points may be acquired by performing field measurement in thephysical world, or may be calculated from the image positions andpositional change relationships of the feature points in the calibrationimage. In practical applications, there are a large number ofsub-regions and a large number of feature points per sub-region, and inthis case, it is not convenient to conduct field measurement. Thus, insome embodiments, the physical positions of the feature points, and thusthe physical ranges of the sub-regions, can be obtained by calculation.Specifically, step S03 includes the following steps S031 to S034.

At step S031, a second transformation relation is determined accordingto a physical position of a bottom of the mark object and an imageposition thereof in the calibration image. The second transformationrelation is a transformation relation between the physical position ofthe bottom of the mark object and the position of the bottom of the markobject in the calibration image.

Optionally, the second transformation relation includes a secondposition transformation matrix H_2 that is determined according to thefollowing equation (2):

$\begin{matrix}{\begin{bmatrix}X \\Y \\1\end{bmatrix} = {\left. H \right.\_{2\begin{bmatrix}{uu} \\{vv} \\1\end{bmatrix}}}} & (2)\end{matrix}$

where uu is a one-dimensional vector formed by the abscissas of thebottoms of the plurality of mark objects in the calibration image; andvv is a one-dimensional vector formed by ordinates of the bottoms of theplurality of mark objects in the calibration image.

Exemplarily, there are four mark objects, and the coordinates of thebottoms of the four mark objects in the physical world coordinate systemare respectively (X1, Y1), (X2, Y2), (X3, Y3) and (X4, Y4). Thecoordinates of the tops of the four mark objects in the calibrationimage are respectively: (uu1, vv1), (uu2, vv2), (uu3, vv3) and (uu4,vv4). Then, the above equation (2) is:

$\begin{bmatrix}{X1} & {X2} & {X3} & {X4} \\{Y1} & {Y2} & {Y3} & {Y4} \\1 & 1 & 1 & 1\end{bmatrix} = {\left. H \right.\_{1\begin{bmatrix}{{uu}1} & {{uu}2} & {{uu}3} & {{uu}4} \\{{vv}l} & {{vv}2} & {{vv}3} & {{vv}4} \\1 & 1 & 1 & 1\end{bmatrix}}}$

At step S032, image positions of the plurality of feature pointsdefining the sub-region in the calibration image are acquired. Forexample, the sub-region is a polygonal region, and the feature pointsare corner points of the polygon.

At step S033, a physical position of each of the plurality of featurepoints is determined according to an image position of the feature pointin the calibration image and the second transformation relation.

At step S034, the physical range of the sub-region is determinedaccording to the physical positions of the plurality of feature points.

After step S03, the method for counting regional population furtherincludes the following steps S1 to S4.

At step S1, an image to be analyzed in a target region is acquired. Theimage to be analyzed may be captured by an image capturing device, andthe image to be analyzed and the calibration image are captured by thesame image capturing device, wherein the image capturing device isinstalled at the same position and same angle. It should be noted thatin practical applications, steps S01 to S03 may be executed once afterthe image capturing device is installed for the first time, and thensteps S1 to S4 may be performed to count the population. Subsequently,under the condition that the image capturing device is fixed, stepsS01-S03 may be not executed any more.

At step S2, an image position of each first human body part in the imageto be analyzed is detected.

Optionally, the first human body part includes a head. The imageposition of the head in the image to be analyzed may be detected using atarget detection algorithm based on deep learning, thereby increasingthe detection speed and accuracy. For example, the target detectionalgorithm may be SSD (Single Shot MultiBox Detector), YOLO (You OnlyLook Once), and the like. The image position of the first human bodypart may be coordinates of a top of a head detection frame in the imageto be analyzed.

At step S3, according to the image position of each first human bodypart and a first transformation relation, a physical position of eachfirst human body part in the target region is determined. The physicalposition of the first human body part in the target region includescoordinates of the first human body part in the target region, which areexpressed in two-dimensional coordinates.

For example, the first transformation relation includes the above firstposition transformation matrix H_1, wherein when the image position(i.e., coordinates) of a first human body part is (ui, vi), the physicalposition (i.e. coordinates) of that first human body part is (Xi, Yi),wherein Xi and Yi are obtained according to the following equation (3):

$\begin{matrix}{\begin{bmatrix}{Xi} \\{Yi} \\1\end{bmatrix} = {\left. H \right.\_{1\begin{bmatrix}{ui} \\{vi} \\1\end{bmatrix}}}} & (3)\end{matrix}$

At step S4, the population in each sub-region is determined according toa relative positional relation between the image position of the firsthuman body part and the sub-image, as well as a relative positionalrelation between the physical position of the first human body part andthe sub-region.

In some embodiments, step S4 includes:

judging, for each sub-region, whether each first human body part islocated in the sub-region in the physical world, and determining thepopulation in the sub-region according to the judgment result. Whenjudging whether any human body key part is located in the sub-region, atwo-level comparison method may be adopted.

FIG. 3 is a flowchart of a two-level comparison method according to anembodiment of the present disclosure. As shown in FIG. 3, the two-levelcomparison method may include the following steps.

At step S401, it is judged whether the image position of the first humanbody part in the image to be analyzed is located in the range of thesub-image, if so, proceed to step S402; and if not, it is determinedthat the first human body part is located outside the sub-region in thephysical world.

FIG. 4A is a schematic diagram showing an image position of a firsthuman body part in an image to be analyzed located within a range of asub-image according to an embodiment of the present disclosure. FIG. 4Bis a schematic diagram showing an image position of a first human bodypart in an image to be analyzed located beyond a range of a sub-imageaccording to an embodiment of the present disclosure. As shown in FIG.4, the image position of the first human body part in the image to beanalyzed is position A. The process of judging whether the imageposition of the first human body part in the image to be analyzed islocated in the range of the sub-image may specifically include:

judging whether a first reference line L1 passing through position A anda boundary E1 of the sub-image have intersections. As shown in FIG. 4A,when the first reference line L1 and the boundary E1 of the sub-imagehave intersections and an odd number of intersections are present onboth sides of position A, it is determined that the image position ofthe first human body part is located in the range of the sub-image. Asshown in FIG. 4B, when the first reference line L1 and the boundary E1of the sub-image have intersections and the intersections are located atthe same side of position A, it is determined that position A is locatedoutside the range of the sub-image. When the first reference line L1 andthe boundary E1 of the sub-image have no intersection, it is alsodetermined that position A is located outside the range of thesub-image.

Exemplarily, the first reference line L1 is a straight line extendingtransversely on the image to be analyzed, that is, points on the firstreference line L1 have the same ordinate. Alternatively, the firstreference line L1 is a straight line extending longitudinally, that is,points on the first reference line L1 have the same abscissa.

At step S402, it is judged whether the physical position of the firsthuman body part is located in the range of the sub-region, if so, it isdetermined that the first human body part is located in the sub-regionin the physical world; and if not, it is determined that the first humanbody part is located outside the sub-region in the physical world. Atthis time, no other judgment is performed, so as to reduce thecalculation amount and increase the processing speed.

The process of judging whether the physical position of the first humanbody part is located in the range of the sub-region is similar to thejudging process in step S401, and may specifically include: judgingwhether a second reference line and a boundary of the sub-region haveintersections; wherein the second reference line is a straight linepassing through the physical position of the first human body part; andwhen the second reference line and the boundary of the sub-region haveintersections and an odd number of intersections are present on bothsides of the physical position of the first human body part, it isdetermined that the physical position of the first human body part islocated in the range of the sub-region.

It should be noted that steps S01 to S03 may be performed before orafter step S1.

FIG. 5 is a schematic diagram of a device for counting regionalpopulation according to an embodiment of the present disclosure. Asshown in FIG. 5, the device for counting regional population includes: afirst acquisition module 10, a detection module 20, a positiondetermination module 30 and a statistics module 40.

The first acquisition module 10 is configured to acquire an image to beanalyzed in a target region, wherein the target region includes at leastone sub-region, and the image to be analyzed includes at least onesub-image corresponding to the at least one sub-region one by one.

The detection module 20 is configured to detect a position of each firsthuman body part in the image to be analyzed.

The position determination module 30 is configured to determine,according to the position of each first human body part in the image tobe analyzed and a first transformation relation, a physical position ofeach first human body part in the target region, wherein the firsttransformation relation is a transformation relation between a physicalposition of an object and a position thereof in the image to beanalyzed.

The statistics module 40 is configured to determine the population ineach sub-region according to a relative positional relation between theposition of the first human body part in the image to be analyzed andthe sub-image, as well as a relative positional relation between thephysical position of the first human body part and the sub-region.

FIG. 6 is a schematic diagram of another device for counting regionalpopulation according to an embodiment of the present disclosure. Asshown in FIG. 6, in some embodiments, the device for counting regionalpopulation further includes: a second acquisition module 50, arelationship generation module 60, and a sub-region calibration module70. The second acquisition module 50 is configured to acquire acalibration image of the target region. The relationship generationmodule 60 is configured to determine the first transformation relationaccording to a physical position of a top of a mark object in the targetregion. The sub-region calibration module 70 is configured to acquire aphysical range of the sub-region.

Functions of the modules are described in the above method for countingregional population, and thus are not repeated here.

In an embodiment of the present disclosure, there is further provided acomputer device, including a processor and a memory. The memory has aprogram stored thereon which, when executed by the processor, causes themethod for counting regional population in any of the above embodimentto be implemented.

In an embodiment of the present disclosure, there is further provided acomputer readable storage medium having a computer program storedthereon, wherein when executed by a processor, the program causes themethod for counting regional population in any of the above embodimentto be implemented.

The above described memory and computer readable storage medium include,but are not limited to: a random access memory (RAM), a read-only memory(ROM), a non-volatile random access memory (NVRAM), a programmableread-only memory (PROM), an erasable programmable read-only memory(EPROM), an electrically erasable programmable read only memory(EEPROM), a flash memory, a magnetic or optical data memory, a register,a magnetic disc or tape, an optical storage medium such as a compactdisc (CD) or a DVD (digital versatile disc), and other non-transitorymedia. Examples of the processor include, but are not limited to,general purpose processors, central processing units (CPUs),microprocessors, digital signal processors (DSPs), controllers,microcontrollers, state machines, and the like.

It will be appreciated that the above embodiments are merely exemplaryembodiments for the purpose of illustrating the principle of thedisclosure, and the disclosure is not limited thereto. Variousmodifications and improvements can be made by a person having ordinaryskill in the art without departing from the spirit and essence of thedisclosure. Accordingly, all of these modifications and improvementsalso fall into the protection scope of the disclosure.

1. A method for counting regional population, comprising: acquiring animage to be analyzed in a target region, wherein the target regioncomprises at least one sub-region, and the image to be analyzedcomprises at least one sub-image corresponding to the at least onesub-region one by one; detecting a position of each first human bodypart in the image to be analyzed; determining, according to the positionof each first human body part in the image to be analyzed and a firsttransformation relation, a physical position of each first human bodypart in the target region, wherein the first transformation relation isa transformation relation between a physical position of the first humanbody part in the target region and a position thereof in the image to beanalyzed; and determining the population in each sub-region according toa relative positional relation between the position of the first humanbody part in the image to be analyzed and the sub-image, as well as arelative positional relation between the physical position of the firsthuman body part and the sub-region.
 2. The method for counting regionalpopulation according to claim 1, wherein the first human body partcomprises a head; the method for counting regional population furthercomprises: acquiring a calibration image of the target region;determining the first transformation relation according to a physicalposition of a preset part of a mark object in the target region and animage position of the preset part of the mark object in the calibrationimage; and acquiring a physical range of the sub-region.
 3. The methodfor counting regional population according to claim 2, wherein a heightof the mark object is within a standard human height range, and thepreset part of the mark object is a top of the mark object.
 4. Themethod for counting regional population according to claim 3, whereinthe step of acquiring the physical range of the sub-region comprises:determining a second transformation relation according to a physicalposition of a bottom of the mark object and a position of the bottom ofthe mark object in the calibration image; wherein the secondtransformation relation is a transformation relation between thephysical position of the bottom of the mark object and the position ofthe bottom of the mark object in the calibration image; acquiringpositions of a plurality of feature points defining the sub-region inthe calibration image; determining a physical position of each featurepoint according to a position of the feature point in the calibrationimage and the second transformation relation; and determining thephysical range of the sub-region according to the physical positions ofthe plurality of feature points.
 5. The method for counting regionalpopulation according to claim 3, wherein a plurality of mark objects arepresent in the target region, and the first transformation relationcomprises a first position transformation matrix that is determinedaccording to the following equation (1): $\begin{matrix}{\begin{bmatrix}X \\Y \\1\end{bmatrix} = {\left. H \right.\_{1\begin{bmatrix}u \\v \\1\end{bmatrix}}}} & (1)\end{matrix}$ where H_1 is the first position transformation matrix; Xis a one-dimensional vector formed by abscissas of the tops of theplurality of the mark objects in a physical world coordinate system; Yis a one-dimensional vector formed by ordinates of the bottoms of theplurality of mark objects in the physical world coordinate system; u isa one-dimensional vector formed by abscissas of the tops of theplurality of mark objects in the calibration image; and v is aone-dimensional vector formed by ordinates of the tops of the pluralityof mark objects in the calibration image.
 6. The method for countingregional population according to claim 5, wherein the secondtransformation relation comprises a second position transformationmatrix that is determined according to the following equation (2):$\begin{matrix}{\begin{bmatrix}X \\Y \\1\end{bmatrix} = {\left. H \right.\_{2\begin{bmatrix}{uu} \\{vv} \\1\end{bmatrix}}}} & (2)\end{matrix}$ where H_2 is the second position transformation matrix; uuis a one-dimensional vector formed by the abscissas of the bottoms ofthe plurality of mark objects in the calibration image; and vv is aone-dimensional vector formed by ordinates of the bottoms of theplurality of mark objects in the calibration image.
 7. The method forcounting regional population according to claim 1, wherein the step ofdetermining the population in each sub-region according to the relativepositional relation between the position of the first human body part inthe image to be analyzed and the sub-image, as well as the relativepositional relation between the physical position of the first humanbody part and the sub-region comprises: judging, for each sub-region,whether each first human body part is located in the sub-region using atwo-level comparison method, and determining the population in thesub-region according to the judgment result; wherein, the two-levelcomparison method comprises: judging whether the position of the firsthuman body part in the image to be analyzed is located in the range ofthe sub-image; judging, when the position of the first human body partin the image to be analyzed is located in the range of the sub-image,whether the physical position of the first human body part is located inthe range of the sub-region; and determining that the first human bodypart is located in the sub-region when the physical position of thefirst human body part is located in the range of the sub-region.
 8. Themethod for counting regional population according to claim 7, whereinthe step of judging whether the position of the first human body part inthe image to be analyzed is located in the range of the sub-imagecomprises: judging whether a first reference line and a boundary of thesub-image have intersections; wherein the first reference line is astraight line passing through the position of the first human body partin the image to be analyzed; and determining that the position of thefirst human body part in the image to be analyzed is located in therange of the sub-image when the first reference line and the boundary ofthe sub-image have intersections, and an odd number of intersections arepresent on both sides of the position of the first human body part inthe image to be analyzed; and judging whether the physical position ofthe first human body part is located in the sub-region, comprising:judging whether a second reference line and a boundary of the sub-regionhave intersections; wherein the second reference line is a straight linepassing through the physical position of the first human body part; anddetermining that the physical position of the first human body part islocated in the sub-region when the second reference line and theboundary of the sub-region have intersections and an odd number ofintersections are present on both sides of the physical position of thefirst human body part.
 9. The method for counting regional populationaccording to claim 1, wherein the position of the first human body partin the image to be analyzed is detected by a target detection algorithmbased on deep learning.
 10. A computer device, comprising: a processor;and a memory having a program stored thereon which, when executed by theprocessor, causes the following steps to be implemented: acquiring animage to be analyzed in a target region, wherein the target regioncomprises at least one sub-region, and the image to be analyzedcomprises at least one sub-image corresponding to the at least onesub-region one by one; detecting a position of each first human bodypart in the image to be analyzed; determining, according to the positionof each first human body part in the image to be analyzed and a firsttransformation relation, a physical position of each first human bodypart in the target region, wherein the first transformation relation isa transformation relation between a physical position of the first humanbody part in the target region and a position thereof in the image to beanalyzed; and determining the population in each sub-region according toa relative positional relation between the position of the first humanbody part in the image to be analyzed and the sub-image, as well as arelative positional relation between the physical position of the firsthuman body part and the sub-region.
 11. The computer device according toclaim 10, wherein the first human body part comprises a head; and theprogram, when executed by the processor, further causes the followingsteps to be implemented: acquiring a calibration image of the targetregion; determining the first transformation relation according to aphysical position of a preset part of a mark object in the target regionand an image position of the preset part of the mark object in thecalibration image; and acquiring a physical range of the sub-region. 12.A computer readable storage medium having a computer program storedthereon, wherein when executed by a processor, the program causes themethod for counting regional population according to claim 1 to beimplemented.